package zyq;

public class Student {
    private String sid;
    private String stuName;
    private String teacher_id;
    //一对一 : 可以理解为一个学生对应一个班主任
    //需要在StuMapper.xml中配置<association 配置Student的成员变量teacher 和其对应的类型，及在mysql中的列名>
    //  <association>标签内要写需要关联teacher2表中的哪些列
    private  Teacher teacher;
    public Student(){}
    public Student(String sid, String name) {
        this.sid = sid;
        this.stuName = name;
    }

    public String getSid() {
        return sid;
    }

    public void setSid(String sid) {
        this.sid = sid;
    }

    public String getStuName() {
        return stuName;
    }

    public void setStuName(String stuName) {
        this.stuName = stuName;
    }

    public Teacher getTeacher() {
        return teacher;
    }

    public void setTeacher(Teacher teacher) {
        this.teacher = teacher;
    }

    public String getTeacher_id() {
        return teacher_id;
    }

    public void setTeacher_id(String teacher_id) {
        this.teacher_id = teacher_id;
    }

    public String toString() {
        return "Student{" +
                "sid='" + sid + '\'' +
                ", stuName='" + stuName + '\'' +
                '}';
    }
}
